<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h2>模板引用</h2>
      <div class="box" ref="box2">box</div>
      <!-- <button @click="handleClick">btn</button> -->
    </div>

    <script src="./lib/vue3.js"></script>
    <script>
      const { createApp } = Vue;

      createApp({
        data() {
          return {};
        },
        // methods: {
        //   handleClick() {
        //     console.log(document.querySelector(".box"));
        //     console.log(this.$refs.box2);
        //   },
        // },
        mounted() {
          console.log(this.$refs.box2);
        },
      }).mount("#app");
    </script>
  </body>
</html>
